﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CitiSurface
{
    /// <summary>
    /// Interaction logic for CitiSurfaceButton.xaml
    /// </summary>
    public partial class CitiSurfaceButton : UserControl
    {
        public static readonly DependencyProperty SourceProperty;

        public string Source
        {
            get { return (string) GetValue(SourceProperty); }
            set { SetValue(SourceProperty, value); }
        }

        public static readonly RoutedEvent ClickEvent;

        public event  RoutedEventHandler Click
        {
            add { AddHandler(ClickEvent, value);}
            remove { RemoveHandler(ClickEvent, value);}
        }

        static CitiSurfaceButton()
        {
            SourceProperty = DependencyProperty.Register("Source", typeof(string),
                                                                           typeof(CitiSurfaceButton));
            ClickEvent = EventManager.RegisterRoutedEvent("Click", RoutingStrategy.Bubble, typeof (RoutedEventHandler),
                                                          typeof (CitiSurfaceButton));
        }

        public CitiSurfaceButton()
        {
            InitializeComponent();
        }

        private void ImageButtonClick(object sender, RoutedEventArgs e)
        {
            RaiseEvent(new RoutedEventArgs(ClickEvent, this));
        }
    }
}
